#include <tree_sitter/parser.h>

#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif

#define LANGUAGE_VERSION 14
#define STATE_COUNT 68
#define LARGE_STATE_COUNT 2
#define SYMBOL_COUNT 50
#define ALIAS_COUNT 0
#define TOKEN_COUNT 27
#define EXTERNAL_TOKEN_COUNT 0
#define FIELD_COUNT 0
#define MAX_ALIAS_SEQUENCE_LENGTH 5
#define PRODUCTION_ID_COUNT 1

enum {
  anon_sym_LT = 1,
  anon_sym_SLASH = 2,
  anon_sym_GT = 3,
  anon_sym_LT_SLASH = 4,
  anon_sym_COLON = 5,
  anon_sym_EQ = 6,
  sym_identifier = 7,
  anon_sym_DQUOTE = 8,
  aux_sym_quoted_string_token1 = 9,
  aux_sym_quoted_string_token2 = 10,
  anon_sym_SQUOTE = 11,
  aux_sym_single_quoted_string_token1 = 12,
  anon_sym_AT = 13,
  anon_sym_AT_BANG = 14,
  anon_sym_AT_QMARK = 15,
  anon_sym_COLON_SLASH_SLASH = 16,
  sym_resource_path = 17,
  anon_sym_QMARK = 18,
  anon_sym_AMP = 19,
  aux_sym_param_token1 = 20,
  anon_sym_POUND = 21,
  aux_sym_term_reference_token1 = 22,
  sym_text = 23,
  anon_sym_LT_BANG_DASH_DASH = 24,
  aux_sym_comment_token1 = 25,
  anon_sym_DASH_DASH_GT = 26,
  sym_document = 27,
  sym__content = 28,
  sym_element = 29,
  sym_self_closing_element = 30,
  sym_paired_element = 31,
  sym_start_tag = 32,
  sym_end_tag = 33,
  sym_tag_name = 34,
  sym_attribute = 35,
  sym_quoted_string = 36,
  sym_single_quoted_string = 37,
  sym_resource_reference = 38,
  sym_protocol_spec = 39,
  sym_query_params = 40,
  sym_param_list = 41,
  sym_param = 42,
  sym_term_reference = 43,
  sym_comment = 44,
  aux_sym_document_repeat1 = 45,
  aux_sym_self_closing_element_repeat1 = 46,
  aux_sym_quoted_string_repeat1 = 47,
  aux_sym_single_quoted_string_repeat1 = 48,
  aux_sym_param_list_repeat1 = 49,
};

static const char * const ts_symbol_names[] = {
  [ts_builtin_sym_end] = "end",
  [anon_sym_LT] = "<",
  [anon_sym_SLASH] = "/",
  [anon_sym_GT] = ">",
  [anon_sym_LT_SLASH] = "</",
  [anon_sym_COLON] = ":",
  [anon_sym_EQ] = "=",
  [sym_identifier] = "identifier",
  [anon_sym_DQUOTE] = "\"",
  [aux_sym_quoted_string_token1] = "quoted_string_token1",
  [aux_sym_quoted_string_token2] = "quoted_string_token2",
  [anon_sym_SQUOTE] = "'",
  [aux_sym_single_quoted_string_token1] = "single_quoted_string_token1",
  [anon_sym_AT] = "@",
  [anon_sym_AT_BANG] = "@!",
  [anon_sym_AT_QMARK] = "@\?",
  [anon_sym_COLON_SLASH_SLASH] = "://",
  [sym_resource_path] = "resource_path",
  [anon_sym_QMARK] = "\?",
  [anon_sym_AMP] = "&",
  [aux_sym_param_token1] = "param_token1",
  [anon_sym_POUND] = "#",
  [aux_sym_term_reference_token1] = "term_reference_token1",
  [sym_text] = "text",
  [anon_sym_LT_BANG_DASH_DASH] = "<!--",
  [aux_sym_comment_token1] = "comment_token1",
  [anon_sym_DASH_DASH_GT] = "-->",
  [sym_document] = "document",
  [sym__content] = "_content",
  [sym_element] = "element",
  [sym_self_closing_element] = "self_closing_element",
  [sym_paired_element] = "paired_element",
  [sym_start_tag] = "start_tag",
  [sym_end_tag] = "end_tag",
  [sym_tag_name] = "tag_name",
  [sym_attribute] = "attribute",
  [sym_quoted_string] = "quoted_string",
  [sym_single_quoted_string] = "single_quoted_string",
  [sym_resource_reference] = "resource_reference",
  [sym_protocol_spec] = "protocol_spec",
  [sym_query_params] = "query_params",
  [sym_param_list] = "param_list",
  [sym_param] = "param",
  [sym_term_reference] = "term_reference",
  [sym_comment] = "comment",
  [aux_sym_document_repeat1] = "document_repeat1",
  [aux_sym_self_closing_element_repeat1] = "self_closing_element_repeat1",
  [aux_sym_quoted_string_repeat1] = "quoted_string_repeat1",
  [aux_sym_single_quoted_string_repeat1] = "single_quoted_string_repeat1",
  [aux_sym_param_list_repeat1] = "param_list_repeat1",
};

static const TSSymbol ts_symbol_map[] = {
  [ts_builtin_sym_end] = ts_builtin_sym_end,
  [anon_sym_LT] = anon_sym_LT,
  [anon_sym_SLASH] = anon_sym_SLASH,
  [anon_sym_GT] = anon_sym_GT,
  [anon_sym_LT_SLASH] = anon_sym_LT_SLASH,
  [anon_sym_COLON] = anon_sym_COLON,
  [anon_sym_EQ] = anon_sym_EQ,
  [sym_identifier] = sym_identifier,
  [anon_sym_DQUOTE] = anon_sym_DQUOTE,
  [aux_sym_quoted_string_token1] = aux_sym_quoted_string_token1,
  [aux_sym_quoted_string_token2] = aux_sym_quoted_string_token2,
  [anon_sym_SQUOTE] = anon_sym_SQUOTE,
  [aux_sym_single_quoted_string_token1] = aux_sym_single_quoted_string_token1,
  [anon_sym_AT] = anon_sym_AT,
  [anon_sym_AT_BANG] = anon_sym_AT_BANG,
  [anon_sym_AT_QMARK] = anon_sym_AT_QMARK,
  [anon_sym_COLON_SLASH_SLASH] = anon_sym_COLON_SLASH_SLASH,
  [sym_resource_path] = sym_resource_path,
  [anon_sym_QMARK] = anon_sym_QMARK,
  [anon_sym_AMP] = anon_sym_AMP,
  [aux_sym_param_token1] = aux_sym_param_token1,
  [anon_sym_POUND] = anon_sym_POUND,
  [aux_sym_term_reference_token1] = aux_sym_term_reference_token1,
  [sym_text] = sym_text,
  [anon_sym_LT_BANG_DASH_DASH] = anon_sym_LT_BANG_DASH_DASH,
  [aux_sym_comment_token1] = aux_sym_comment_token1,
  [anon_sym_DASH_DASH_GT] = anon_sym_DASH_DASH_GT,
  [sym_document] = sym_document,
  [sym__content] = sym__content,
  [sym_element] = sym_element,
  [sym_self_closing_element] = sym_self_closing_element,
  [sym_paired_element] = sym_paired_element,
  [sym_start_tag] = sym_start_tag,
  [sym_end_tag] = sym_end_tag,
  [sym_tag_name] = sym_tag_name,
  [sym_attribute] = sym_attribute,
  [sym_quoted_string] = sym_quoted_string,
  [sym_single_quoted_string] = sym_single_quoted_string,
  [sym_resource_reference] = sym_resource_reference,
  [sym_protocol_spec] = sym_protocol_spec,
  [sym_query_params] = sym_query_params,
  [sym_param_list] = sym_param_list,
  [sym_param] = sym_param,
  [sym_term_reference] = sym_term_reference,
  [sym_comment] = sym_comment,
  [aux_sym_document_repeat1] = aux_sym_document_repeat1,
  [aux_sym_self_closing_element_repeat1] = aux_sym_self_closing_element_repeat1,
  [aux_sym_quoted_string_repeat1] = aux_sym_quoted_string_repeat1,
  [aux_sym_single_quoted_string_repeat1] = aux_sym_single_quoted_string_repeat1,
  [aux_sym_param_list_repeat1] = aux_sym_param_list_repeat1,
};

static const TSSymbolMetadata ts_symbol_metadata[] = {
  [ts_builtin_sym_end] = {
    .visible = false,
    .named = true,
  },
  [anon_sym_LT] = {
    .visible = true,
    .named = false,
  },
  [anon_sym_SLASH] = {
    .visible = true,
    .named = false,
  },
  [anon_sym_GT] = {
    .visible = true,
    .named = false,
  },
  [anon_sym_LT_SLASH] = {
    .visible = true,
    .named = false,
  },
  [anon_sym_COLON] = {
    .visible = true,
    .named = false,
  },
  [anon_sym_EQ] = {
    .visible = true,
    .named = false,
  },
  [sym_identifier] = {
    .visible = true,
    .named = true,
  },
  [anon_sym_DQUOTE] = {
    .visible = true,
    .named = false,
  },
  [aux_sym_quoted_string_token1] = {
    .visible = false,
    .named = false,
  },
  [aux_sym_quoted_string_token2] = {
    .visible = false,
    .named = false,
  },
  [anon_sym_SQUOTE] = {
    .visible = true,
    .named = false,
  },
  [aux_sym_single_quoted_string_token1] = {
    .visible = false,
    .named = false,
  },
  [anon_sym_AT] = {
    .visible = true,
    .named = false,
  },
  [anon_sym_AT_BANG] = {
    .visible = true,
    .named = false,
  },
  [anon_sym_AT_QMARK] = {
    .visible = true,
    .named = false,
  },
  [anon_sym_COLON_SLASH_SLASH] = {
    .visible = true,
    .named = false,
  },
  [sym_resource_path] = {
    .visible = true,
    .named = true,
  },
  [anon_sym_QMARK] = {
    .visible = true,
    .named = false,
  },
  [anon_sym_AMP] = {
    .visible = true,
    .named = false,
  },
  [aux_sym_param_token1] = {
    .visible = false,
    .named = false,
  },
  [anon_sym_POUND] = {
    .visible = true,
    .named = false,
  },
  [aux_sym_term_reference_token1] = {
    .visible = false,
    .named = false,
  },
  [sym_text] = {
    .visible = true,
    .named = true,
  },
  [anon_sym_LT_BANG_DASH_DASH] = {
    .visible = true,
    .named = false,
  },
  [aux_sym_comment_token1] = {
    .visible = false,
    .named = false,
  },
  [anon_sym_DASH_DASH_GT] = {
    .visible = true,
    .named = false,
  },
  [sym_document] = {
    .visible = true,
    .named = true,
  },
  [sym__content] = {
    .visible = false,
    .named = true,
  },
  [sym_element] = {
    .visible = true,
    .named = true,
  },
  [sym_self_closing_element] = {
    .visible = true,
    .named = true,
  },
  [sym_paired_element] = {
    .visible = true,
    .named = true,
  },
  [sym_start_tag] = {
    .visible = true,
    .named = true,
  },
  [sym_end_tag] = {
    .visible = true,
    .named = true,
  },
  [sym_tag_name] = {
    .visible = true,
    .named = true,
  },
  [sym_attribute] = {
    .visible = true,
    .named = true,
  },
  [sym_quoted_string] = {
    .visible = true,
    .named = true,
  },
  [sym_single_quoted_string] = {
    .visible = true,
    .named = true,
  },
  [sym_resource_reference] = {
    .visible = true,
    .named = true,
  },
  [sym_protocol_spec] = {
    .visible = true,
    .named = true,
  },
  [sym_query_params] = {
    .visible = true,
    .named = true,
  },
  [sym_param_list] = {
    .visible = true,
    .named = true,
  },
  [sym_param] = {
    .visible = true,
    .named = true,
  },
  [sym_term_reference] = {
    .visible = true,
    .named = true,
  },
  [sym_comment] = {
    .visible = true,
    .named = true,
  },
  [aux_sym_document_repeat1] = {
    .visible = false,
    .named = false,
  },
  [aux_sym_self_closing_element_repeat1] = {
    .visible = false,
    .named = false,
  },
  [aux_sym_quoted_string_repeat1] = {
    .visible = false,
    .named = false,
  },
  [aux_sym_single_quoted_string_repeat1] = {
    .visible = false,
    .named = false,
  },
  [aux_sym_param_list_repeat1] = {
    .visible = false,
    .named = false,
  },
};

static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = {
  [0] = {0},
};

static const uint16_t ts_non_terminal_alias_map[] = {
  0,
};

static const TSStateId ts_primary_state_ids[STATE_COUNT] = {
  [0] = 0,
  [1] = 1,
  [2] = 2,
  [3] = 3,
  [4] = 4,
  [5] = 5,
  [6] = 6,
  [7] = 7,
  [8] = 8,
  [9] = 9,
  [10] = 10,
  [11] = 11,
  [12] = 12,
  [13] = 13,
  [14] = 14,
  [15] = 15,
  [16] = 16,
  [17] = 17,
  [18] = 18,
  [19] = 19,
  [20] = 20,
  [21] = 21,
  [22] = 22,
  [23] = 23,
  [24] = 24,
  [25] = 25,
  [26] = 26,
  [27] = 27,
  [28] = 28,
  [29] = 29,
  [30] = 30,
  [31] = 31,
  [32] = 32,
  [33] = 33,
  [34] = 34,
  [35] = 35,
  [36] = 36,
  [37] = 37,
  [38] = 38,
  [39] = 39,
  [40] = 40,
  [41] = 41,
  [42] = 42,
  [43] = 43,
  [44] = 44,
  [45] = 45,
  [46] = 46,
  [47] = 47,
  [48] = 48,
  [49] = 49,
  [50] = 50,
  [51] = 51,
  [52] = 52,
  [53] = 53,
  [54] = 54,
  [55] = 55,
  [56] = 56,
  [57] = 57,
  [58] = 58,
  [59] = 59,
  [60] = 60,
  [61] = 61,
  [62] = 62,
  [63] = 63,
  [64] = 64,
  [65] = 65,
  [66] = 66,
  [67] = 67,
};

static bool ts_lex(TSLexer *lexer, TSStateId state) {
  START_LEXER();
  eof = lexer->eof(lexer);
  switch (state) {
    case 0:
      if (eof) ADVANCE(15);
      if (lookahead == '"') ADVANCE(23);
      if (lookahead == '#') ADVANCE(42);
      if (lookahead == '&') ADVANCE(39);
      if (lookahead == '\'') ADVANCE(28);
      if (lookahead == '-') ADVANCE(4);
      if (lookahead == '/') ADVANCE(17);
      if (lookahead == ':') ADVANCE(20);
      if (lookahead == '<') ADVANCE(16);
      if (lookahead == '=') ADVANCE(21);
      if (lookahead == '>') ADVANCE(18);
      if (lookahead == '?') ADVANCE(37);
      if (lookahead == '@') ADVANCE(32);
      if (lookahead == '\\') ADVANCE(11);
      if (lookahead == '\t' ||
          lookahead == '\n' ||
          lookahead == '\r' ||
          lookahead == ' ') SKIP(0)
      if (('A' <= lookahead && lookahead <= 'Z') ||
          ('a' <= lookahead && lookahead <= 'z')) ADVANCE(22);
      END_STATE();
    case 1:
      if (lookahead == '!') ADVANCE(6);
      END_STATE();
    case 2:
      if (lookahead == '"') ADVANCE(23);
      if (lookahead == '<') ADVANCE(25);
      if (lookahead == '\\') ADVANCE(11);
      if (lookahead == '\t' ||
          lookahead == '\n' ||
          lookahead == '\r' ||
          lookahead == ' ') ADVANCE(26);
      if (lookahead != 0) ADVANCE(24);
      END_STATE();
    case 3:
      if (lookahead == '\'') ADVANCE(28);
      if (lookahead == '<') ADVANCE(30);
      if (lookahead == '\\') ADVANCE(11);
      if (lookahead == '\t' ||
          lookahead == '\n' ||
          lookahead == '\r' ||
          lookahead == ' ') ADVANCE(31);
      if (lookahead != 0) ADVANCE(29);
      END_STATE();
    case 4:
      if (lookahead == '-') ADVANCE(10);
      END_STATE();
    case 5:
      if (lookahead == '-') ADVANCE(48);
      END_STATE();
    case 6:
      if (lookahead == '-') ADVANCE(5);
      END_STATE();
    case 7:
      if (lookahead == '/') ADVANCE(35);
      END_STATE();
    case 8:
      if (lookahead == '<') ADVANCE(1);
      if (lookahead == '\t' ||
          lookahead == '\n' ||
          lookahead == '\r' ||
          lookahead == ' ') SKIP(8)
      if (lookahead != 0 &&
          lookahead != '>' &&
          lookahead != '?') ADVANCE(36);
      END_STATE();
    case 9:
      if (lookahead == '<') ADVANCE(1);
      if (lookahead == '\t' ||
          lookahead == '\n' ||
          lookahead == '\r' ||
          lookahead == ' ') SKIP(9)
      if (lookahead != 0 &&
          lookahead != '>') ADVANCE(43);
      END_STATE();
    case 10:
      if (lookahead == '>') ADVANCE(55);
      END_STATE();
    case 11:
      if (lookahead != 0 &&
          lookahead != '\n') ADVANCE(27);
      END_STATE();
    case 12:
      if (eof) ADVANCE(15);
      if (lookahead == '#') ADVANCE(42);
      if (lookahead == '&') ADVANCE(40);
      if (lookahead == '<') ADVANCE(16);
      if (lookahead == '@') ADVANCE(32);
      if (lookahead == '\t' ||
          lookahead == '\n' ||
          lookahead == '\r' ||
          lookahead == ' ') ADVANCE(44);
      if (lookahead != 0) ADVANCE(47);
      END_STATE();
    case 13:
      if (eof) ADVANCE(15);
      if (lookahead == '#') ADVANCE(42);
      if (lookahead == '<') ADVANCE(16);
      if (lookahead == '?') ADVANCE(38);
      if (lookahead == '@') ADVANCE(32);
      if (lookahead == '\t' ||
          lookahead == '\n' ||
          lookahead == '\r' ||
          lookahead == ' ') ADVANCE(45);
      if (lookahead != 0) ADVANCE(47);
      END_STATE();
    case 14:
      if (eof) ADVANCE(15);
      if (lookahead == '#') ADVANCE(42);
      if (lookahead == '<') ADVANCE(16);
      if (lookahead == '@') ADVANCE(32);
      if (lookahead == '\t' ||
          lookahead == '\n' ||
          lookahead == '\r' ||
          lookahead == ' ') ADVANCE(46);
      if (lookahead != 0) ADVANCE(47);
      END_STATE();
    case 15:
      ACCEPT_TOKEN(ts_builtin_sym_end);
      END_STATE();
    case 16:
      ACCEPT_TOKEN(anon_sym_LT);
      if (lookahead == '!') ADVANCE(6);
      if (lookahead == '/') ADVANCE(19);
      END_STATE();
    case 17:
      ACCEPT_TOKEN(anon_sym_SLASH);
      END_STATE();
    case 18:
      ACCEPT_TOKEN(anon_sym_GT);
      END_STATE();
    case 19:
      ACCEPT_TOKEN(anon_sym_LT_SLASH);
      END_STATE();
    case 20:
      ACCEPT_TOKEN(anon_sym_COLON);
      if (lookahead == '/') ADVANCE(7);
      END_STATE();
    case 21:
      ACCEPT_TOKEN(anon_sym_EQ);
      END_STATE();
    case 22:
      ACCEPT_TOKEN(sym_identifier);
      if (lookahead == '-' ||
          ('0' <= lookahead && lookahead <= '9') ||
          ('A' <= lookahead && lookahead <= 'Z') ||
          lookahead == '_' ||
          ('a' <= lookahead && lookahead <= 'z')) ADVANCE(22);
      END_STATE();
    case 23:
      ACCEPT_TOKEN(anon_sym_DQUOTE);
      END_STATE();
    case 24:
      ACCEPT_TOKEN(aux_sym_quoted_string_token1);
      END_STATE();
    case 25:
      ACCEPT_TOKEN(aux_sym_quoted_string_token1);
      if (lookahead == '!') ADVANCE(6);
      END_STATE();
    case 26:
      ACCEPT_TOKEN(aux_sym_quoted_string_token1);
      if (lookahead == '<') ADVANCE(25);
      if (lookahead == '\t' ||
          lookahead == '\n' ||
          lookahead == '\r' ||
          lookahead == ' ') ADVANCE(26);
      if (lookahead != 0 &&
          lookahead != '"' &&
          lookahead != '\\') ADVANCE(24);
      END_STATE();
    case 27:
      ACCEPT_TOKEN(aux_sym_quoted_string_token2);
      END_STATE();
    case 28:
      ACCEPT_TOKEN(anon_sym_SQUOTE);
      END_STATE();
    case 29:
      ACCEPT_TOKEN(aux_sym_single_quoted_string_token1);
      END_STATE();
    case 30:
      ACCEPT_TOKEN(aux_sym_single_quoted_string_token1);
      if (lookahead == '!') ADVANCE(6);
      END_STATE();
    case 31:
      ACCEPT_TOKEN(aux_sym_single_quoted_string_token1);
      if (lookahead == '<') ADVANCE(30);
      if (lookahead == '\t' ||
          lookahead == '\n' ||
          lookahead == '\r' ||
          lookahead == ' ') ADVANCE(31);
      if (lookahead != 0 &&
          lookahead != '\'' &&
          lookahead != '\\') ADVANCE(29);
      END_STATE();
    case 32:
      ACCEPT_TOKEN(anon_sym_AT);
      if (lookahead == '!') ADVANCE(33);
      if (lookahead == '?') ADVANCE(34);
      END_STATE();
    case 33:
      ACCEPT_TOKEN(anon_sym_AT_BANG);
      END_STATE();
    case 34:
      ACCEPT_TOKEN(anon_sym_AT_QMARK);
      END_STATE();
    case 35:
      ACCEPT_TOKEN(anon_sym_COLON_SLASH_SLASH);
      END_STATE();
    case 36:
      ACCEPT_TOKEN(sym_resource_path);
      if (lookahead != 0 &&
          lookahead != '\t' &&
          lookahead != '\n' &&
          lookahead != '\r' &&
          lookahead != ' ' &&
          lookahead != '<' &&
          lookahead != '>' &&
          lookahead != '?') ADVANCE(36);
      END_STATE();
    case 37:
      ACCEPT_TOKEN(anon_sym_QMARK);
      END_STATE();
    case 38:
      ACCEPT_TOKEN(anon_sym_QMARK);
      if (lookahead != 0 &&
          lookahead != '#' &&
          lookahead != '<' &&
          lookahead != '@') ADVANCE(47);
      END_STATE();
    case 39:
      ACCEPT_TOKEN(anon_sym_AMP);
      END_STATE();
    case 40:
      ACCEPT_TOKEN(anon_sym_AMP);
      if (lookahead != 0 &&
          lookahead != '#' &&
          lookahead != '<' &&
          lookahead != '@') ADVANCE(47);
      END_STATE();
    case 41:
      ACCEPT_TOKEN(aux_sym_param_token1);
      if (lookahead != 0 &&
          lookahead != '\t' &&
          lookahead != '\n' &&
          lookahead != '\r' &&
          lookahead != ' ' &&
          lookahead != '&' &&
          lookahead != '<' &&
          lookahead != '>') ADVANCE(41);
      END_STATE();
    case 42:
      ACCEPT_TOKEN(anon_sym_POUND);
      END_STATE();
    case 43:
      ACCEPT_TOKEN(aux_sym_term_reference_token1);
      if (lookahead != 0 &&
          lookahead != '\t' &&
          lookahead != '\n' &&
          lookahead != '\r' &&
          lookahead != ' ' &&
          lookahead != '<' &&
          lookahead != '>') ADVANCE(43);
      END_STATE();
    case 44:
      ACCEPT_TOKEN(sym_text);
      if (lookahead == '&') ADVANCE(40);
      if (lookahead == '\t' ||
          lookahead == '\n' ||
          lookahead == '\r' ||
          lookahead == ' ') ADVANCE(44);
      if (lookahead != 0 &&
          lookahead != '#' &&
          lookahead != '<' &&
          lookahead != '@') ADVANCE(47);
      END_STATE();
    case 45:
      ACCEPT_TOKEN(sym_text);
      if (lookahead == '?') ADVANCE(38);
      if (lookahead == '\t' ||
          lookahead == '\n' ||
          lookahead == '\r' ||
          lookahead == ' ') ADVANCE(45);
      if (lookahead != 0 &&
          lookahead != '#' &&
          lookahead != '<' &&
          lookahead != '@') ADVANCE(47);
      END_STATE();
    case 46:
      ACCEPT_TOKEN(sym_text);
      if (lookahead == '\t' ||
          lookahead == '\n' ||
          lookahead == '\r' ||
          lookahead == ' ') ADVANCE(46);
      if (lookahead != 0 &&
          lookahead != '#' &&
          lookahead != '<' &&
          lookahead != '@') ADVANCE(47);
      END_STATE();
    case 47:
      ACCEPT_TOKEN(sym_text);
      if (lookahead != 0 &&
          lookahead != '#' &&
          lookahead != '<' &&
          lookahead != '@') ADVANCE(47);
      END_STATE();
    case 48:
      ACCEPT_TOKEN(anon_sym_LT_BANG_DASH_DASH);
      END_STATE();
    case 49:
      ACCEPT_TOKEN(anon_sym_LT_BANG_DASH_DASH);
      if (lookahead == '-') ADVANCE(52);
      if (lookahead != 0 &&
          lookahead != '>') ADVANCE(52);
      END_STATE();
    case 50:
      ACCEPT_TOKEN(aux_sym_comment_token1);
      if (lookahead == '!') ADVANCE(54);
      if (lookahead == '-') ADVANCE(52);
      if (lookahead != 0 &&
          lookahead != '>') ADVANCE(52);
      END_STATE();
    case 51:
      ACCEPT_TOKEN(aux_sym_comment_token1);
      if (lookahead == '-') ADVANCE(52);
      if (lookahead == '<') ADVANCE(50);
      if (lookahead == '\t' ||
          lookahead == '\n' ||
          lookahead == '\r' ||
          lookahead == ' ') ADVANCE(51);
      if (lookahead != 0 &&
          lookahead != '>') ADVANCE(52);
      END_STATE();
    case 52:
      ACCEPT_TOKEN(aux_sym_comment_token1);
      if (lookahead == '-') ADVANCE(52);
      if (lookahead != 0 &&
          lookahead != '>') ADVANCE(52);
      END_STATE();
    case 53:
      ACCEPT_TOKEN(aux_sym_comment_token1);
      if (lookahead == '-') ADVANCE(49);
      if (lookahead != 0 &&
          lookahead != '>') ADVANCE(52);
      END_STATE();
    case 54:
      ACCEPT_TOKEN(aux_sym_comment_token1);
      if (lookahead == '-') ADVANCE(53);
      if (lookahead != 0 &&
          lookahead != '>') ADVANCE(52);
      END_STATE();
    case 55:
      ACCEPT_TOKEN(anon_sym_DASH_DASH_GT);
      END_STATE();
    default:
      return false;
  }
}

static const TSLexMode ts_lex_modes[STATE_COUNT] = {
  [0] = {.lex_state = 0},
  [1] = {.lex_state = 14},
  [2] = {.lex_state = 14},
  [3] = {.lex_state = 14},
  [4] = {.lex_state = 14},
  [5] = {.lex_state = 14},
  [6] = {.lex_state = 12},
  [7] = {.lex_state = 12},
  [8] = {.lex_state = 13},
  [9] = {.lex_state = 12},
  [10] = {.lex_state = 12},
  [11] = {.lex_state = 12},
  [12] = {.lex_state = 14},
  [13] = {.lex_state = 14},
  [14] = {.lex_state = 14},
  [15] = {.lex_state = 14},
  [16] = {.lex_state = 14},
  [17] = {.lex_state = 14},
  [18] = {.lex_state = 14},
  [19] = {.lex_state = 14},
  [20] = {.lex_state = 14},
  [21] = {.lex_state = 14},
  [22] = {.lex_state = 14},
  [23] = {.lex_state = 14},
  [24] = {.lex_state = 14},
  [25] = {.lex_state = 14},
  [26] = {.lex_state = 14},
  [27] = {.lex_state = 0},
  [28] = {.lex_state = 0},
  [29] = {.lex_state = 0},
  [30] = {.lex_state = 0},
  [31] = {.lex_state = 3},
  [32] = {.lex_state = 3},
  [33] = {.lex_state = 2},
  [34] = {.lex_state = 0},
  [35] = {.lex_state = 3},
  [36] = {.lex_state = 2},
  [37] = {.lex_state = 2},
  [38] = {.lex_state = 0},
  [39] = {.lex_state = 0},
  [40] = {.lex_state = 0},
  [41] = {.lex_state = 0},
  [42] = {.lex_state = 0},
  [43] = {.lex_state = 0},
  [44] = {.lex_state = 3},
  [45] = {.lex_state = 0},
  [46] = {.lex_state = 2},
  [47] = {.lex_state = 0},
  [48] = {.lex_state = 0},
  [49] = {.lex_state = 0},
  [50] = {.lex_state = 0},
  [51] = {.lex_state = 0},
  [52] = {.lex_state = 0},
  [53] = {.lex_state = 0},
  [54] = {.lex_state = 0},
  [55] = {.lex_state = 8},
  [56] = {.lex_state = 0},
  [57] = {.lex_state = 0},
  [58] = {.lex_state = 0},
  [59] = {.lex_state = 51},
  [60] = {.lex_state = 0},
  [61] = {.lex_state = 0},
  [62] = {.lex_state = 0},
  [63] = {.lex_state = 0},
  [64] = {.lex_state = 41},
  [65] = {.lex_state = 0},
  [66] = {.lex_state = 9},
  [67] = {(TSStateId)(-1)},
};

static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = {
  [0] = {
    [sym_comment] = STATE(0),
    [ts_builtin_sym_end] = ACTIONS(1),
    [anon_sym_LT] = ACTIONS(1),
    [anon_sym_SLASH] = ACTIONS(1),
    [anon_sym_GT] = ACTIONS(1),
    [anon_sym_LT_SLASH] = ACTIONS(1),
    [anon_sym_COLON] = ACTIONS(1),
    [anon_sym_EQ] = ACTIONS(1),
    [sym_identifier] = ACTIONS(1),
    [anon_sym_DQUOTE] = ACTIONS(1),
    [aux_sym_quoted_string_token2] = ACTIONS(1),
    [anon_sym_SQUOTE] = ACTIONS(1),
    [anon_sym_AT] = ACTIONS(1),
    [anon_sym_AT_BANG] = ACTIONS(1),
    [anon_sym_AT_QMARK] = ACTIONS(1),
    [anon_sym_COLON_SLASH_SLASH] = ACTIONS(1),
    [anon_sym_QMARK] = ACTIONS(1),
    [anon_sym_AMP] = ACTIONS(1),
    [anon_sym_POUND] = ACTIONS(1),
    [anon_sym_LT_BANG_DASH_DASH] = ACTIONS(3),
    [anon_sym_DASH_DASH_GT] = ACTIONS(1),
  },
  [1] = {
    [sym_document] = STATE(65),
    [sym__content] = STATE(21),
    [sym_element] = STATE(19),
    [sym_self_closing_element] = STATE(20),
    [sym_paired_element] = STATE(20),
    [sym_start_tag] = STATE(2),
    [sym_resource_reference] = STATE(19),
    [sym_term_reference] = STATE(19),
    [sym_comment] = STATE(1),
    [aux_sym_document_repeat1] = STATE(5),
    [ts_builtin_sym_end] = ACTIONS(5),
    [anon_sym_LT] = ACTIONS(7),
    [anon_sym_AT] = ACTIONS(9),
    [anon_sym_AT_BANG] = ACTIONS(9),
    [anon_sym_AT_QMARK] = ACTIONS(9),
    [anon_sym_POUND] = ACTIONS(11),
    [sym_text] = ACTIONS(13),
    [anon_sym_LT_BANG_DASH_DASH] = ACTIONS(15),
  },
};

static const uint16_t ts_small_parse_table[] = {
  [0] = 12,
    ACTIONS(7), 1,
      anon_sym_LT,
    ACTIONS(11), 1,
      anon_sym_POUND,
    ACTIONS(13), 1,
      sym_text,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(17), 1,
      anon_sym_LT_SLASH,
    STATE(4), 1,
      aux_sym_document_repeat1,
    STATE(18), 1,
      sym_end_tag,
    STATE(21), 1,
      sym__content,
    STATE(2), 2,
      sym_start_tag,
      sym_comment,
    STATE(20), 2,
      sym_self_closing_element,
      sym_paired_element,
    ACTIONS(9), 3,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
    STATE(19), 3,
      sym_element,
      sym_resource_reference,
      sym_term_reference,
  [43] = 12,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(19), 1,
      ts_builtin_sym_end,
    ACTIONS(21), 1,
      anon_sym_LT,
    ACTIONS(24), 1,
      anon_sym_LT_SLASH,
    ACTIONS(29), 1,
      anon_sym_POUND,
    ACTIONS(32), 1,
      sym_text,
    STATE(2), 1,
      sym_start_tag,
    STATE(21), 1,
      sym__content,
    STATE(3), 2,
      sym_comment,
      aux_sym_document_repeat1,
    STATE(20), 2,
      sym_self_closing_element,
      sym_paired_element,
    ACTIONS(26), 3,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
    STATE(19), 3,
      sym_element,
      sym_resource_reference,
      sym_term_reference,
  [86] = 13,
    ACTIONS(7), 1,
      anon_sym_LT,
    ACTIONS(11), 1,
      anon_sym_POUND,
    ACTIONS(13), 1,
      sym_text,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(17), 1,
      anon_sym_LT_SLASH,
    STATE(2), 1,
      sym_start_tag,
    STATE(3), 1,
      aux_sym_document_repeat1,
    STATE(4), 1,
      sym_comment,
    STATE(21), 1,
      sym__content,
    STATE(23), 1,
      sym_end_tag,
    STATE(20), 2,
      sym_self_closing_element,
      sym_paired_element,
    ACTIONS(9), 3,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
    STATE(19), 3,
      sym_element,
      sym_resource_reference,
      sym_term_reference,
  [131] = 12,
    ACTIONS(7), 1,
      anon_sym_LT,
    ACTIONS(11), 1,
      anon_sym_POUND,
    ACTIONS(13), 1,
      sym_text,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(35), 1,
      ts_builtin_sym_end,
    STATE(2), 1,
      sym_start_tag,
    STATE(3), 1,
      aux_sym_document_repeat1,
    STATE(5), 1,
      sym_comment,
    STATE(21), 1,
      sym__content,
    STATE(20), 2,
      sym_self_closing_element,
      sym_paired_element,
    ACTIONS(9), 3,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
    STATE(19), 3,
      sym_element,
      sym_resource_reference,
      sym_term_reference,
  [173] = 6,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(37), 1,
      ts_builtin_sym_end,
    ACTIONS(41), 1,
      anon_sym_AMP,
    STATE(6), 1,
      sym_comment,
    STATE(7), 1,
      aux_sym_param_list_repeat1,
    ACTIONS(39), 7,
      anon_sym_LT,
      anon_sym_LT_SLASH,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
      anon_sym_POUND,
      sym_text,
  [198] = 6,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(41), 1,
      anon_sym_AMP,
    ACTIONS(43), 1,
      ts_builtin_sym_end,
    STATE(7), 1,
      sym_comment,
    STATE(9), 1,
      aux_sym_param_list_repeat1,
    ACTIONS(45), 7,
      anon_sym_LT,
      anon_sym_LT_SLASH,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
      anon_sym_POUND,
      sym_text,
  [223] = 6,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(47), 1,
      ts_builtin_sym_end,
    ACTIONS(51), 1,
      anon_sym_QMARK,
    STATE(8), 1,
      sym_comment,
    STATE(13), 1,
      sym_query_params,
    ACTIONS(49), 7,
      anon_sym_LT,
      anon_sym_LT_SLASH,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
      anon_sym_POUND,
      sym_text,
  [248] = 5,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(53), 1,
      ts_builtin_sym_end,
    ACTIONS(57), 1,
      anon_sym_AMP,
    STATE(9), 2,
      sym_comment,
      aux_sym_param_list_repeat1,
    ACTIONS(55), 7,
      anon_sym_LT,
      anon_sym_LT_SLASH,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
      anon_sym_POUND,
      sym_text,
  [271] = 4,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(53), 1,
      ts_builtin_sym_end,
    STATE(10), 1,
      sym_comment,
    ACTIONS(55), 8,
      anon_sym_LT,
      anon_sym_LT_SLASH,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
      anon_sym_AMP,
      anon_sym_POUND,
      sym_text,
  [291] = 4,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(60), 1,
      ts_builtin_sym_end,
    STATE(11), 1,
      sym_comment,
    ACTIONS(62), 8,
      anon_sym_LT,
      anon_sym_LT_SLASH,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
      anon_sym_AMP,
      anon_sym_POUND,
      sym_text,
  [311] = 4,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    STATE(12), 1,
      sym_comment,
    ACTIONS(64), 2,
      ts_builtin_sym_end,
      sym_text,
    ACTIONS(66), 6,
      anon_sym_LT,
      anon_sym_LT_SLASH,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
      anon_sym_POUND,
  [330] = 4,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    STATE(13), 1,
      sym_comment,
    ACTIONS(68), 2,
      ts_builtin_sym_end,
      sym_text,
    ACTIONS(70), 6,
      anon_sym_LT,
      anon_sym_LT_SLASH,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
      anon_sym_POUND,
  [349] = 4,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    STATE(14), 1,
      sym_comment,
    ACTIONS(72), 2,
      ts_builtin_sym_end,
      sym_text,
    ACTIONS(74), 6,
      anon_sym_LT,
      anon_sym_LT_SLASH,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
      anon_sym_POUND,
  [368] = 4,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    STATE(15), 1,
      sym_comment,
    ACTIONS(76), 2,
      ts_builtin_sym_end,
      sym_text,
    ACTIONS(78), 6,
      anon_sym_LT,
      anon_sym_LT_SLASH,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
      anon_sym_POUND,
  [387] = 4,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    STATE(16), 1,
      sym_comment,
    ACTIONS(80), 2,
      ts_builtin_sym_end,
      sym_text,
    ACTIONS(82), 6,
      anon_sym_LT,
      anon_sym_LT_SLASH,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
      anon_sym_POUND,
  [406] = 4,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    STATE(17), 1,
      sym_comment,
    ACTIONS(84), 2,
      ts_builtin_sym_end,
      sym_text,
    ACTIONS(86), 6,
      anon_sym_LT,
      anon_sym_LT_SLASH,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
      anon_sym_POUND,
  [425] = 4,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    STATE(18), 1,
      sym_comment,
    ACTIONS(88), 2,
      ts_builtin_sym_end,
      sym_text,
    ACTIONS(90), 6,
      anon_sym_LT,
      anon_sym_LT_SLASH,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
      anon_sym_POUND,
  [444] = 4,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    STATE(19), 1,
      sym_comment,
    ACTIONS(92), 2,
      ts_builtin_sym_end,
      sym_text,
    ACTIONS(94), 6,
      anon_sym_LT,
      anon_sym_LT_SLASH,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
      anon_sym_POUND,
  [463] = 4,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    STATE(20), 1,
      sym_comment,
    ACTIONS(96), 2,
      ts_builtin_sym_end,
      sym_text,
    ACTIONS(98), 6,
      anon_sym_LT,
      anon_sym_LT_SLASH,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
      anon_sym_POUND,
  [482] = 4,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    STATE(21), 1,
      sym_comment,
    ACTIONS(100), 2,
      ts_builtin_sym_end,
      sym_text,
    ACTIONS(102), 6,
      anon_sym_LT,
      anon_sym_LT_SLASH,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
      anon_sym_POUND,
  [501] = 4,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    STATE(22), 1,
      sym_comment,
    ACTIONS(47), 2,
      ts_builtin_sym_end,
      sym_text,
    ACTIONS(49), 6,
      anon_sym_LT,
      anon_sym_LT_SLASH,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
      anon_sym_POUND,
  [520] = 4,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    STATE(23), 1,
      sym_comment,
    ACTIONS(104), 2,
      ts_builtin_sym_end,
      sym_text,
    ACTIONS(106), 6,
      anon_sym_LT,
      anon_sym_LT_SLASH,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
      anon_sym_POUND,
  [539] = 4,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    STATE(24), 1,
      sym_comment,
    ACTIONS(108), 2,
      ts_builtin_sym_end,
      sym_text,
    ACTIONS(110), 6,
      anon_sym_LT,
      anon_sym_LT_SLASH,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
      anon_sym_POUND,
  [558] = 4,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(114), 1,
      sym_text,
    STATE(25), 1,
      sym_comment,
    ACTIONS(112), 6,
      anon_sym_LT,
      anon_sym_LT_SLASH,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
      anon_sym_POUND,
  [576] = 4,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(118), 1,
      sym_text,
    STATE(26), 1,
      sym_comment,
    ACTIONS(116), 6,
      anon_sym_LT,
      anon_sym_LT_SLASH,
      anon_sym_AT,
      anon_sym_AT_BANG,
      anon_sym_AT_QMARK,
      anon_sym_POUND,
  [594] = 7,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(120), 1,
      anon_sym_SLASH,
    ACTIONS(122), 1,
      anon_sym_GT,
    ACTIONS(124), 1,
      sym_identifier,
    STATE(27), 1,
      sym_comment,
    STATE(29), 1,
      aux_sym_self_closing_element_repeat1,
    STATE(40), 1,
      sym_attribute,
  [616] = 5,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(128), 1,
      sym_identifier,
    STATE(40), 1,
      sym_attribute,
    ACTIONS(126), 2,
      anon_sym_SLASH,
      anon_sym_GT,
    STATE(28), 2,
      sym_comment,
      aux_sym_self_closing_element_repeat1,
  [634] = 7,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(124), 1,
      sym_identifier,
    ACTIONS(131), 1,
      anon_sym_SLASH,
    ACTIONS(133), 1,
      anon_sym_GT,
    STATE(28), 1,
      aux_sym_self_closing_element_repeat1,
    STATE(29), 1,
      sym_comment,
    STATE(40), 1,
      sym_attribute,
  [656] = 5,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(135), 1,
      anon_sym_DQUOTE,
    ACTIONS(137), 1,
      anon_sym_SQUOTE,
    STATE(30), 1,
      sym_comment,
    STATE(45), 2,
      sym_quoted_string,
      sym_single_quoted_string,
  [673] = 5,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(141), 1,
      anon_sym_SQUOTE,
    STATE(31), 1,
      sym_comment,
    STATE(35), 1,
      aux_sym_single_quoted_string_repeat1,
    ACTIONS(139), 2,
      aux_sym_quoted_string_token2,
      aux_sym_single_quoted_string_token1,
  [690] = 4,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(146), 1,
      anon_sym_SQUOTE,
    ACTIONS(143), 2,
      aux_sym_quoted_string_token2,
      aux_sym_single_quoted_string_token1,
    STATE(32), 2,
      sym_comment,
      aux_sym_single_quoted_string_repeat1,
  [705] = 4,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(148), 1,
      anon_sym_DQUOTE,
    ACTIONS(150), 2,
      aux_sym_quoted_string_token1,
      aux_sym_quoted_string_token2,
    STATE(33), 2,
      sym_comment,
      aux_sym_quoted_string_repeat1,
  [720] = 4,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(155), 1,
      anon_sym_COLON,
    STATE(34), 1,
      sym_comment,
    ACTIONS(153), 3,
      anon_sym_SLASH,
      anon_sym_GT,
      sym_identifier,
  [735] = 5,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(157), 1,
      anon_sym_SQUOTE,
    STATE(32), 1,
      aux_sym_single_quoted_string_repeat1,
    STATE(35), 1,
      sym_comment,
    ACTIONS(139), 2,
      aux_sym_quoted_string_token2,
      aux_sym_single_quoted_string_token1,
  [752] = 5,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(159), 1,
      anon_sym_DQUOTE,
    STATE(33), 1,
      aux_sym_quoted_string_repeat1,
    STATE(36), 1,
      sym_comment,
    ACTIONS(161), 2,
      aux_sym_quoted_string_token1,
      aux_sym_quoted_string_token2,
  [769] = 5,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(163), 1,
      anon_sym_DQUOTE,
    STATE(36), 1,
      aux_sym_quoted_string_repeat1,
    STATE(37), 1,
      sym_comment,
    ACTIONS(161), 2,
      aux_sym_quoted_string_token1,
      aux_sym_quoted_string_token2,
  [786] = 3,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    STATE(38), 1,
      sym_comment,
    ACTIONS(165), 3,
      anon_sym_SLASH,
      anon_sym_GT,
      sym_identifier,
  [798] = 3,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    STATE(39), 1,
      sym_comment,
    ACTIONS(167), 3,
      anon_sym_SLASH,
      anon_sym_GT,
      sym_identifier,
  [810] = 3,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    STATE(40), 1,
      sym_comment,
    ACTIONS(169), 3,
      anon_sym_SLASH,
      anon_sym_GT,
      sym_identifier,
  [822] = 3,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    STATE(41), 1,
      sym_comment,
    ACTIONS(171), 3,
      anon_sym_SLASH,
      anon_sym_GT,
      sym_identifier,
  [834] = 5,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(173), 1,
      sym_identifier,
    ACTIONS(175), 1,
      anon_sym_AT,
    STATE(22), 1,
      sym_protocol_spec,
    STATE(42), 1,
      sym_comment,
  [850] = 3,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    STATE(43), 1,
      sym_comment,
    ACTIONS(177), 3,
      anon_sym_SLASH,
      anon_sym_GT,
      sym_identifier,
  [862] = 3,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    STATE(44), 1,
      sym_comment,
    ACTIONS(179), 3,
      aux_sym_quoted_string_token2,
      anon_sym_SQUOTE,
      aux_sym_single_quoted_string_token1,
  [874] = 3,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    STATE(45), 1,
      sym_comment,
    ACTIONS(181), 3,
      anon_sym_SLASH,
      anon_sym_GT,
      sym_identifier,
  [886] = 3,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    STATE(46), 1,
      sym_comment,
    ACTIONS(183), 3,
      anon_sym_DQUOTE,
      aux_sym_quoted_string_token1,
      aux_sym_quoted_string_token2,
  [898] = 3,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    STATE(47), 1,
      sym_comment,
    ACTIONS(185), 3,
      anon_sym_SLASH,
      anon_sym_GT,
      sym_identifier,
  [910] = 5,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(187), 1,
      sym_identifier,
    STATE(6), 1,
      sym_param,
    STATE(12), 1,
      sym_param_list,
    STATE(48), 1,
      sym_comment,
  [926] = 4,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(189), 1,
      anon_sym_COLON,
    ACTIONS(191), 1,
      anon_sym_COLON_SLASH_SLASH,
    STATE(49), 1,
      sym_comment,
  [939] = 4,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(193), 1,
      sym_identifier,
    STATE(50), 1,
      sym_comment,
    STATE(63), 1,
      sym_tag_name,
  [952] = 4,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(173), 1,
      sym_identifier,
    STATE(13), 1,
      sym_protocol_spec,
    STATE(51), 1,
      sym_comment,
  [965] = 4,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(187), 1,
      sym_identifier,
    STATE(10), 1,
      sym_param,
    STATE(52), 1,
      sym_comment,
  [978] = 4,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(173), 1,
      sym_identifier,
    STATE(15), 1,
      sym_protocol_spec,
    STATE(53), 1,
      sym_comment,
  [991] = 4,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(193), 1,
      sym_identifier,
    STATE(27), 1,
      sym_tag_name,
    STATE(54), 1,
      sym_comment,
  [1004] = 3,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(195), 1,
      sym_resource_path,
    STATE(55), 1,
      sym_comment,
  [1014] = 3,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(197), 1,
      sym_identifier,
    STATE(56), 1,
      sym_comment,
  [1024] = 3,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(199), 1,
      anon_sym_GT,
    STATE(57), 1,
      sym_comment,
  [1034] = 3,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(201), 1,
      anon_sym_EQ,
    STATE(58), 1,
      sym_comment,
  [1044] = 3,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(203), 1,
      aux_sym_comment_token1,
    STATE(59), 1,
      sym_comment,
  [1054] = 3,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(205), 1,
      anon_sym_DASH_DASH_GT,
    STATE(60), 1,
      sym_comment,
  [1064] = 3,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(207), 1,
      anon_sym_GT,
    STATE(61), 1,
      sym_comment,
  [1074] = 3,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(209), 1,
      anon_sym_EQ,
    STATE(62), 1,
      sym_comment,
  [1084] = 3,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(211), 1,
      anon_sym_GT,
    STATE(63), 1,
      sym_comment,
  [1094] = 3,
    ACTIONS(15), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(213), 1,
      aux_sym_param_token1,
    STATE(64), 1,
      sym_comment,
  [1104] = 3,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(215), 1,
      ts_builtin_sym_end,
    STATE(65), 1,
      sym_comment,
  [1114] = 3,
    ACTIONS(3), 1,
      anon_sym_LT_BANG_DASH_DASH,
    ACTIONS(217), 1,
      aux_sym_term_reference_token1,
    STATE(66), 1,
      sym_comment,
  [1124] = 1,
    ACTIONS(219), 1,
      ts_builtin_sym_end,
};

static const uint32_t ts_small_parse_table_map[] = {
  [SMALL_STATE(2)] = 0,
  [SMALL_STATE(3)] = 43,
  [SMALL_STATE(4)] = 86,
  [SMALL_STATE(5)] = 131,
  [SMALL_STATE(6)] = 173,
  [SMALL_STATE(7)] = 198,
  [SMALL_STATE(8)] = 223,
  [SMALL_STATE(9)] = 248,
  [SMALL_STATE(10)] = 271,
  [SMALL_STATE(11)] = 291,
  [SMALL_STATE(12)] = 311,
  [SMALL_STATE(13)] = 330,
  [SMALL_STATE(14)] = 349,
  [SMALL_STATE(15)] = 368,
  [SMALL_STATE(16)] = 387,
  [SMALL_STATE(17)] = 406,
  [SMALL_STATE(18)] = 425,
  [SMALL_STATE(19)] = 444,
  [SMALL_STATE(20)] = 463,
  [SMALL_STATE(21)] = 482,
  [SMALL_STATE(22)] = 501,
  [SMALL_STATE(23)] = 520,
  [SMALL_STATE(24)] = 539,
  [SMALL_STATE(25)] = 558,
  [SMALL_STATE(26)] = 576,
  [SMALL_STATE(27)] = 594,
  [SMALL_STATE(28)] = 616,
  [SMALL_STATE(29)] = 634,
  [SMALL_STATE(30)] = 656,
  [SMALL_STATE(31)] = 673,
  [SMALL_STATE(32)] = 690,
  [SMALL_STATE(33)] = 705,
  [SMALL_STATE(34)] = 720,
  [SMALL_STATE(35)] = 735,
  [SMALL_STATE(36)] = 752,
  [SMALL_STATE(37)] = 769,
  [SMALL_STATE(38)] = 786,
  [SMALL_STATE(39)] = 798,
  [SMALL_STATE(40)] = 810,
  [SMALL_STATE(41)] = 822,
  [SMALL_STATE(42)] = 834,
  [SMALL_STATE(43)] = 850,
  [SMALL_STATE(44)] = 862,
  [SMALL_STATE(45)] = 874,
  [SMALL_STATE(46)] = 886,
  [SMALL_STATE(47)] = 898,
  [SMALL_STATE(48)] = 910,
  [SMALL_STATE(49)] = 926,
  [SMALL_STATE(50)] = 939,
  [SMALL_STATE(51)] = 952,
  [SMALL_STATE(52)] = 965,
  [SMALL_STATE(53)] = 978,
  [SMALL_STATE(54)] = 991,
  [SMALL_STATE(55)] = 1004,
  [SMALL_STATE(56)] = 1014,
  [SMALL_STATE(57)] = 1024,
  [SMALL_STATE(58)] = 1034,
  [SMALL_STATE(59)] = 1044,
  [SMALL_STATE(60)] = 1054,
  [SMALL_STATE(61)] = 1064,
  [SMALL_STATE(62)] = 1074,
  [SMALL_STATE(63)] = 1084,
  [SMALL_STATE(64)] = 1094,
  [SMALL_STATE(65)] = 1104,
  [SMALL_STATE(66)] = 1114,
  [SMALL_STATE(67)] = 1124,
};

static const TSParseActionEntry ts_parse_actions[] = {
  [0] = {.entry = {.count = 0, .reusable = false}},
  [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(),
  [3] = {.entry = {.count = 1, .reusable = true}}, SHIFT(59),
  [5] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_document, 0),
  [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(54),
  [9] = {.entry = {.count = 1, .reusable = false}}, SHIFT(53),
  [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(66),
  [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19),
  [15] = {.entry = {.count = 1, .reusable = false}}, SHIFT(59),
  [17] = {.entry = {.count = 1, .reusable = false}}, SHIFT(50),
  [19] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_document_repeat1, 2),
  [21] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_document_repeat1, 2), SHIFT_REPEAT(54),
  [24] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_document_repeat1, 2),
  [26] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_document_repeat1, 2), SHIFT_REPEAT(53),
  [29] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_document_repeat1, 2), SHIFT_REPEAT(66),
  [32] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_document_repeat1, 2), SHIFT_REPEAT(19),
  [35] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_document, 1),
  [37] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param_list, 1),
  [39] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_param_list, 1),
  [41] = {.entry = {.count = 1, .reusable = false}}, SHIFT(52),
  [43] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param_list, 2),
  [45] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_param_list, 2),
  [47] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_protocol_spec, 3),
  [49] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_protocol_spec, 3),
  [51] = {.entry = {.count = 1, .reusable = false}}, SHIFT(48),
  [53] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_param_list_repeat1, 2),
  [55] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_param_list_repeat1, 2),
  [57] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_param_list_repeat1, 2), SHIFT_REPEAT(52),
  [60] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param, 3),
  [62] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_param, 3),
  [64] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_query_params, 2),
  [66] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_query_params, 2),
  [68] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_protocol_spec, 4),
  [70] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_protocol_spec, 4),
  [72] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_self_closing_element, 5),
  [74] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_self_closing_element, 5),
  [76] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_resource_reference, 2),
  [78] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_resource_reference, 2),
  [80] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_term_reference, 2),
  [82] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_term_reference, 2),
  [84] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_end_tag, 3),
  [86] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_end_tag, 3),
  [88] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_paired_element, 2),
  [90] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_paired_element, 2),
  [92] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__content, 1),
  [94] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__content, 1),
  [96] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_element, 1),
  [98] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_element, 1),
  [100] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_document_repeat1, 1),
  [102] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_document_repeat1, 1),
  [104] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_paired_element, 3),
  [106] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_paired_element, 3),
  [108] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_self_closing_element, 4),
  [110] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_self_closing_element, 4),
  [112] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_start_tag, 3),
  [114] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_start_tag, 3),
  [116] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_start_tag, 4),
  [118] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_start_tag, 4),
  [120] = {.entry = {.count = 1, .reusable = true}}, SHIFT(61),
  [122] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25),
  [124] = {.entry = {.count = 1, .reusable = true}}, SHIFT(62),
  [126] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_self_closing_element_repeat1, 2),
  [128] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_self_closing_element_repeat1, 2), SHIFT_REPEAT(62),
  [131] = {.entry = {.count = 1, .reusable = true}}, SHIFT(57),
  [133] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26),
  [135] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37),
  [137] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31),
  [139] = {.entry = {.count = 1, .reusable = false}}, SHIFT(44),
  [141] = {.entry = {.count = 1, .reusable = false}}, SHIFT(43),
  [143] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_single_quoted_string_repeat1, 2), SHIFT_REPEAT(44),
  [146] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_single_quoted_string_repeat1, 2),
  [148] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_quoted_string_repeat1, 2),
  [150] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_quoted_string_repeat1, 2), SHIFT_REPEAT(46),
  [153] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tag_name, 1),
  [155] = {.entry = {.count = 1, .reusable = true}}, SHIFT(56),
  [157] = {.entry = {.count = 1, .reusable = false}}, SHIFT(39),
  [159] = {.entry = {.count = 1, .reusable = false}}, SHIFT(38),
  [161] = {.entry = {.count = 1, .reusable = false}}, SHIFT(46),
  [163] = {.entry = {.count = 1, .reusable = false}}, SHIFT(47),
  [165] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_quoted_string, 3),
  [167] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_single_quoted_string, 3),
  [169] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_self_closing_element_repeat1, 1),
  [171] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tag_name, 3),
  [173] = {.entry = {.count = 1, .reusable = true}}, SHIFT(49),
  [175] = {.entry = {.count = 1, .reusable = true}}, SHIFT(51),
  [177] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_single_quoted_string, 2),
  [179] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_single_quoted_string_repeat1, 1),
  [181] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute, 3),
  [183] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_quoted_string_repeat1, 1),
  [185] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_quoted_string, 2),
  [187] = {.entry = {.count = 1, .reusable = true}}, SHIFT(58),
  [189] = {.entry = {.count = 1, .reusable = false}}, SHIFT(42),
  [191] = {.entry = {.count = 1, .reusable = true}}, SHIFT(55),
  [193] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34),
  [195] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8),
  [197] = {.entry = {.count = 1, .reusable = true}}, SHIFT(41),
  [199] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14),
  [201] = {.entry = {.count = 1, .reusable = true}}, SHIFT(64),
  [203] = {.entry = {.count = 1, .reusable = false}}, SHIFT(60),
  [205] = {.entry = {.count = 1, .reusable = true}}, SHIFT(67),
  [207] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24),
  [209] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30),
  [211] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17),
  [213] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11),
  [215] = {.entry = {.count = 1, .reusable = true}},  ACCEPT_INPUT(),
  [217] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16),
  [219] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_comment, 3),
};

#ifdef __cplusplus
extern "C" {
#endif
#ifdef _WIN32
#define extern __declspec(dllexport)
#endif

extern const TSLanguage *tree_sitter_dpml(void) {
  static const TSLanguage language = {
    .version = LANGUAGE_VERSION,
    .symbol_count = SYMBOL_COUNT,
    .alias_count = ALIAS_COUNT,
    .token_count = TOKEN_COUNT,
    .external_token_count = EXTERNAL_TOKEN_COUNT,
    .state_count = STATE_COUNT,
    .large_state_count = LARGE_STATE_COUNT,
    .production_id_count = PRODUCTION_ID_COUNT,
    .field_count = FIELD_COUNT,
    .max_alias_sequence_length = MAX_ALIAS_SEQUENCE_LENGTH,
    .parse_table = &ts_parse_table[0][0],
    .small_parse_table = ts_small_parse_table,
    .small_parse_table_map = ts_small_parse_table_map,
    .parse_actions = ts_parse_actions,
    .symbol_names = ts_symbol_names,
    .symbol_metadata = ts_symbol_metadata,
    .public_symbol_map = ts_symbol_map,
    .alias_map = ts_non_terminal_alias_map,
    .alias_sequences = &ts_alias_sequences[0][0],
    .lex_modes = ts_lex_modes,
    .lex_fn = ts_lex,
    .primary_state_ids = ts_primary_state_ids,
  };
  return &language;
}
#ifdef __cplusplus
}
#endif
